/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/10
 * Time:16:22
 **/
public class Main1 {
    /**
     * 每日一题-用位运算符实现加法
     * @param A 数字1
     * @param B 数字2
     * @return 相加结果
     */
    public int addAB(int A, int B) {
        int sum = 0;
        int carray = 0;
        while(B != 0){
            sum = A^B;
            carray = (A&B)<<1;
            A = sum;
            B = carray;
        }
        return A;
    }
}
